<template>
  <el-form-item v-show="isShow" :label="i18nt('designer.setting.fontType')">
    <el-select v-model="optionModel.fontType">
      <el-option v-for="item in bgTypes" :key="item.value" :label="item.label" :value="item.value">
      </el-option>
    </el-select>
  </el-form-item>
</template>

<script>
export default {
  name: 'FontTypeEditor',
  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object
  },
  data() {
    return {
      bgTypes: [
        { label: '正常', value: 0 },
        { label: '斜体', value: 1 },
        { label: '粗体', value: 2 }
      ]
    }
  },
  computed: {
    isShow() {
      // 当组件为 button , 并且 isTitle 为 0 时，不显示
      if (
        this.selectedWidget &&
        this.selectedWidget.type === 'button' &&
        this.selectedWidget.options.isTitle === 0
      ) {
        return false
      }

      return true
    }
  }
}
</script>

<style scoped></style>
